package cn.haohaowo.spring.chapter4;

import junit.framework.Assert;

import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.core.io.ResourceLoader;

public class ResourceLoaderAwareTest {

	@Test
	public void testResourceLoaderAware() {
		ApplicationContext ctx = new ClassPathXmlApplicationContext("chapter-app.xml");
		ResourceBean resourceBean = ctx.getBean(ResourceBean.class);
		ResourceLoader loader = resourceBean.getResourceLoader();
		Assert.assertTrue(loader instanceof ApplicationContext);
	}
}
